package com.zs.blog.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @Title: Authority
 * @Author zs
 * @Package com.zs.blog.model.entity
 * @Date 2025/9/2 20:49
 * @description: 系统资源权限实体类
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("um_authority")
public class Authority {
    @Schema(description = "权限ID")
    @TableId(type = IdType.AUTO)
    public Long id;

    @Schema(description = "权限描述")
    public String authorityDescription;

    @Schema(description = "权限描述符")
    public String authorityDescriptor;

    @Schema(description = "菜单 ID，0 表示该权限为顶层说明，没有对应菜单ID")
    public Long menuId;

    @Schema(description = "父 ID，默认为 0")
    public Long parentId;

    @Schema(description = "是否删除[0:否，1:是]")
    public Integer isDeleted;

    @Schema(description = "创建时间")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd hh-mm-ss", shape = JsonFormat.Shape.STRING)
    @TableField(fill = FieldFill.INSERT)
    public LocalDateTime createTime;

    @Schema(description = "更新时间")
    @JsonFormat(timezone = "GMT+8", locale = "zh", pattern = "yyyy-MM-dd hh:mm:ss", shape = JsonFormat.Shape.STRING)
    @TableField(fill = FieldFill.INSERT_UPDATE)
    public LocalDateTime updateTime;
}
